import request from '@/config/axios'

//创建
export const interfaceCreate = async (data) => {
  return await request.post({
    url: '/amp/dynamic-interface/create',
    data
  })
}
//删除
export const interfaceDelete = async (id) => {
  return await request.delete({
    url: '/amp/dynamic-interface/delete?id=' + id
  })
}
//执行
export const interfaceExecute = async (address, data) => {
  return await request.post({
    url: '/amp/dynamic-interface/execute/' + address,
    data
  })
}
//获取
export const interfaceGet = async (id) => {
  return await request.get({
    url: '/amp/dynamic-interface/get?id=' + id
  })
}
//列表
export const interfacePage = async (params) => {
  return await request.getOriginal({
    url: '/amp/dynamic-interface/page',
    params
  })
}
//更新
export const interfaceUpdate = async (data) => {
  return await request.put({
    url: '/amp/dynamic-interface/update',
    data
  })
}
